package controllers;

import java.util.ArrayList;
import java.util.List;
import models.ActionLog;
import models.User;
import play.mvc.Controller;

public class ActionLogs extends Controller{
	
	/**
	 * @author Zeyad Gasser
	 * @component 1
	 * @userStory 15
	 * 
	 * render the viewLog html page containing the log.
	 */
	public static void viewLog() {
		String username = session.get("username");
		User userLoggedIn = User.getUserInfo(username);
		if (userLoggedIn == null) {
			render("Application/notLoggedIn.html");
		}
		List<ActionLog> log = new ArrayList<ActionLog>();
		log = ActionLog.findAll();
		if(log != null)
			render(log);
		else render();
	}
}
